// for backward compatibility only can use the $secure.rt.url macro directly where needed function getSecureProtocol() { var secureRT = context.get("secure.rt.url"); var idx = secureRT.indexOf("/servlet/hotspace."); return secureRT.substring(0,idx); } function browserTest() { var isMicrosoft = (navigator.appName.indexOf("Microsoft") != -1); var isNetscape = (navigator.appName.indexOf("Netscape") != -1); var isMacintosh = (navigator.appVersion.indexOf("Macintosh") != -1); var versionNo = parseFloat(navigator.appVersion); var message = ""; if (isMacintosh) { confirm(context.get("js_alert.mac.not.supported")); return false; } if (isMicrosoft && versionNo >= 4) { return true; } else if (isNetscape) { if (versionNo >= 4.5) { return true; } else { if (confirm(context.get("js_alert.nn405.msg"))) top.location = "http://www.netscape.com/computing/download"; } } else if (confirm(context.get("js_alert.unknown.browser"))) top.location = "http://www.microsoft.com/windows/ie/download/default.asp"; return false; } function browserTestUCM() { var isMicrosoft = (navigator.appName.indexOf("Microsoft") != -1); var isNetscape = (navigator.appName.indexOf("Netscape") != -1); var isMacintosh = (navigator.appVersion.indexOf("Macintosh") != -1); var versionNo = navigator.appVersion; var index = versionNo.indexOf( "MSIE" ); if ( index != -1 ) versionNo = versionNo.substring( index+"MSIE".length, versionNo.length ); versionNo = parseFloat(versionNo); var message = ""; if (isMacintosh) { confirm(context.get("js_alert.mac.not.supported")); return false; } if (isMicrosoft) { var actualVersionIndex = navigator.appVersion.indexOf("MSIE"); versionNo = parseFloat(navigator.appVersion.substring(actualVersionIndex+5)); //alert(versionNo); } if (isMicrosoft && versionNo >= 5) { return true; } else if (confirm(context.get("js_alert.unknown.browser"))) top.location = "http://www.microsoft.com/windows/ie/download/default.asp"; return false; } // this is called by the co-branded websites to get the Member Registration form function register(sponsorId, locale) { if (browserTest()) { ret = "/edit/rt?c=hotspace.rt.handler.MemberSubscription&m=gethtml&sponsor_id=" + sponsorId + (locale ? "&locale="+locale : "") + "&_hs_style_=Corporate&homesite=" + location.host; } return ret; } function registerUCM(sponsorId, locale) { if (browserTestUCM()) { ret = "/edit/rt?c=hotspace.ucm.registration.MemberRegistration&m=gethtml&sponsor_id=" + sponsorId + (locale ? "&locale="+locale : "") + "&_hs_style_=Corporate&homesite=" + location.host; } return ret; } // this is called after a trial to get the Member Registration form function registerAfterTrial() { if (browserTest()) { ret = "/edit/rt?c=hotspace.rt.handler.MemberSubscription&m=gethtml&isReRego=true"; } return ret; } function login(loginform) { if (browserTest()) { loginform.method = "POST"; loginform.action = context.get("secure.rt.url"); loginform.target = "_top"; if (loginform.exit_url) loginform.exit_url.value = top.location.href; loginform.submit(); } } // this is called by the registration form component to submit the first part of the rego process function registerPart1(regoform) { if (browserTest()) { regoform.method = "POST"; regoform.action = getSecureProtocol() + "/edit/rt"; if (regoform.exit_url) regoform.exit_url.value = top.location.href; regoform.submit(); } } function ucmRegisterPart1(regoform) { if (browserTest()) { regoform.method = "POST"; regoform.action = "http://"+context.get("host")+"/edit/rt"; if (regoform.exit_url) regoform.exit_url.value = top.location.href; regoform.submit(); } } // this is called by the sponsor registration form component to submit the sponsor rego process function registerSponsor(regoform) { if (browserTest()) { regoform.method = "POST"; regoform.action = getSecureProtocol() + "/edit/rt"; regoform.submit(); } } var dbug=false function startDemo() { if (browserTest()) { var pos; if (document.all) pos = "left=5,top=5,width="+(screen.availWidth-23)+",height="+(screen.availHeight-60); else pos = "screenX=1,screenY=1,outerWidth="+(screen.availWidth-2)+",outerHeight="+(screen.availHeight-2); var url = '/edit/rt?c=hotspace.rt.handler.demo.Registration&m=register' + '&definer.homesite="/"&sponsor_id=1&email=';//&email='+escape(document.HSFORM.email.value); var attr = pos + ',alwaysRaised=yes,scrollbars=yes' + ',menubar=no,toolbar=no,screenX=200,screenY=50,resizable=yes,status=yes' var newWindow = window.open(url,'newin', dbug ? '' : attr) newWindow.focus(); } } //Look for a version of Internet Explorer that supports ActiveX //or a browser that supports the plugin property of the navigator object and that has Flash Player 2.0 or later installed. //need to create a VBScript function that for IE that creates an object to check if it exists var startTagFix = ''); document.writeln('Function haveActiveXComponent(componentName)'); document.writeln(' on error resume next'); document.writeln(' haveActiveXComponent = False'); document.writeln(' If ScriptEngineMajorVersion >= 2 then'); document.writeln(' haveActiveXComponent = IsObject(CreateObject(componentName))'); document.writeln(' If (err) then'); document.writeln(' haveActiveXComponent = False'); document.writeln(' End If'); document.writeln(' Else'); document.writeln(' haveActiveXComponent = False'); document.writeln(' End If'); document.writeln('End Function'); document.writeln(startTagFix+'script>'); } function haveFlash() { var isMicrosoft = (navigator.appName.indexOf("Microsoft") != -1); var isMacintosh = (navigator.appVersion.indexOf("Mac") != -1); var versionNo = parseFloat(navigator.appVersion); var haveFlash = false; if ( isMicrosoft ) { if ( !isMacintosh && versionNo > 3.1 ) { if ( navigator.appVersion.indexOf( "MSIE 5." ) != -1 ) { // assumed to have flash if IE 5 haveFlash = true; } else { haveFlash = haveActiveXComponent("ShockwaveFlash.ShockwaveFlash"); } } } else { if ( navigator.plugins ) { if ( navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"] ) { haveFlash = true; } } } return haveFlash; } var NS4=(document.layers)?1:0; var IE4=(document.all)?1:0; function wl(){return NS4?(window.pageXOffset):(document.body.scrollLeft)}; function wc(){return wl()+ww()/2}; function ww(){return NS4?window.innerWidth-4:document.body.clientWidth-4}; function wh(){return NS4?window.innerHeight-4:document.body.clientHeight-4}; function popFlashWindow (URL, xsize,ysize, scr) { var left = Math.round(wc()-(xsize/2)); var top = Math.round((wh()-ysize)/2); if( arguments.length > 3 ) addscr = scr; else addscr = 'auto'; var attr = 'height='+ysize+',width='+xsize+',scrollbars=' + addscr + ',resizable=yes,screenX='+left+',screenY='+top+',left='+left+',top='+top var newWindow = window.open(URL,'FlashPopup', dbug ? '' : attr) newWindow.focus(); } function popNamedWindow (URL, name, xsize,ysize, scr, extraChrome) { var left = Math.round(wc()-(xsize/2)); var top = Math.round((wh()-ysize)/2); if( arguments.length > 4 ) addscr = scr; else addscr = 'yes'; var attr = 'height='+ysize+',width='+xsize+',scrollbars=' + addscr + ',resizable=yes,screenX='+left+',screenY='+top+',left='+left+',top='+top if( arguments.length > 5 ) attr = attr + ',' + extraChrome; var newWindow = window.open(URL,name, dbug ? '' : attr) newWindow.focus(); } function flashLink(flashURL, NoFlashURL, xsize,ysize, scr) { if(haveFlash()) popNamedWindow(flashURL, 'FlashPopup', xsize,ysize); else location = NoFlashURL; } function emailCheck (emailStr) { var word="[a-zA-Z0-9]+(\\-+[a-zA-Z0-9]+)*"; var tld="[a-zA-Z]{2,}"; var domainName=word+"(\\."+word+")*\\."+tld; var userName=word+"(\\."+word+")*"; var quotedUserName="\"[^\"]+\""; var ipAddress="\\[(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\]"; var user="("+userName+"|"+quotedUserName+")"; var host="("+domainName+"|"+ipAddress+")"; var emailAddress=user+"@"+host; if (!trim(emailStr).match(new RegExp("^"+emailAddress+"$"))) { alert("Invalid email address"); return false; } return true; } // Provide function for trimming spaces off strings. function ltrim ( s ) { return s.replace( /^\s*/, "" ) } function rtrim ( s ) { return s.replace( /\s*$/, "" ); } function trim ( s ) { return rtrim(ltrim(s)); }